// $Id: input.hpp 2 2009-09-02 08:47:42Z joseph2002 $
/*
 * Copyright 2009 Joseph Wu
 * Distributed under the Boost Software License, Version 1.0.
 * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
 *
 * For more information, see http://xpcomplus.sourceforge.net
 */

#ifndef XPGEN_INPUT_HPP
#define XPGEN_INPUT_HPP

#include <set>
#include <string>
#include <boost/filesystem/path.hpp>

namespace xpgen {

struct module_decl;

class input
{
public:
    input();
    virtual ~input();

    // options
    bool verbose;
    boost::filesystem::path input_dir;
    boost::filesystem::path input_file;
    std::string ns_override;

    virtual void do_all(module_decl* module);

protected:
    // Process order is:
    // do_reset -> do_module
    virtual void do_reset();
    virtual void do_module() = 0;

protected:
    module_decl* module() const
    {
        return module_;
    }

private:
    void reset();

    module_decl* module_;
};

} // namespace xpgen

#endif // XPGEN_INPUT_HPP
